package com.yuke.cloud.service.omc.service;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.yuke.cloud.common.core.support.IService;
import com.yuke.cloud.common.util.wrapper.Wrapper;
import com.yuke.cloud.service.api.cmc.dto.CmsSecKillSkuDto;
import com.yuke.cloud.service.api.omc.dto.DmsStoreOrderApi;
import com.yuke.cloud.service.api.omc.dto.OdsOrderApiDto;
import com.yuke.cloud.service.api.omc.dto.StoreOrderDto;
import com.yuke.cloud.service.api.smc.dto.ShopInfoDto;
import com.yuke.cloud.service.omc.dto.OrderGoodsDto;
import com.yuke.cloud.service.omc.dto.OrderInfoDto;
import com.yuke.cloud.service.omc.dto.OrderShopDto;
import com.yuke.cloud.service.omc.dto.ShopOrderGoodsDto;
import com.yuke.cloud.service.omc.entity.OdsOrder;
import com.yuke.cloud.service.omc.entity.OdsOrderGoods;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;


/**
 * Created by ssx on 2018/09/03.
 */
public interface OdsOrderService extends IService<OdsOrder> {

    List<OdsOrder> findAll();

    List<OdsOrderGoods> Creatord(Long orderId, List<Map<String, String>> list, Long userid, Map s12, List<Map> transprice1, String shippingType, List<Map<String, String>> listPostscript);

    List<OdsOrder> findbystatus(OdsOrder ods);

 List<OdsOrderGoods> createoderbyshop(List<Map<String, String>> listObjectFir, Long ueseid, Object price, Long shopid, String type, Map receivemap, String shippingType, String postscript);

    List<OdsOrder> countsales(Date begintime, Date endtinme, Long shopid);

    List<Map<String, Object>> countsalesbymonth(Date begintime, Date endtinme, Long longshopid);

    List<Map<String, Object>> countsalesbyquarter(Date begintime, Date endtinme, Long longshopid);

    List<Map<String, Object>> countsalesbyday(Date begintime, Date endtinme, Long longshopid);

    List<Map<String, Object>> countProductsalesbytime(Date begintime, Date endtinme, Long longshopid, Object productid, String bywhat);

    List<Map<String, Object>> countAmountPayableByMonth(Date begintime, Date endtinme, Long longshopid);

    List<OdsOrder> transferEveryday(Integer day);

    long getsnowid();

    Integer batchupdate(@Param("list") List<OdsOrder> odsOrders);

    List<Map> recommond01(List<Long> spec_id);

    List<Map> recommond02(@Param("order_id") List<Long> order_id);

 //统计当周销售额
    List<Map> countsalebyweek(@Param("shopid") Long shopid);

    //统计某个时间段的销售额，按天分类排序
    List<Map> countsalesbytime(@Param("begintime") Date begintime, @Param("endtime") Date endtinme, @Param("shopid") Long shopid);


    //统计某个时间段的销售数量，按天分类
    List<Map> countnumbytime(@Param("begintime") Date begintime, @Param("endtime") Date endtinme, @Param("shopid") Long shopid);

    List<Map> getgoods(@Param("shopids") List<Long> list1);

    List<Map> getfinish();

    Map selectaddressbyid(Long id);

    Map<String, String> haveShopStockCount(List<Map<String, String>> listSpecs);

    /**
     * 统计指定店铺已获得的返利总额
     *
     * @param shopId
     * @return
     */
    Integer getAlrdyAmountCheckout(Long shopId);

 Integer getAlrdyAmountDiscount(Date beginTime, Date endTime, Long shopId);

 /**
  * 统计指定店铺预估当月的返利总额
  *
  * @param shopId
  * @return
  */
    Integer getPreAmountCheckout(Long shopId);

 /**
  * 统计指定店铺当月购买总额
  *
  * @param shopId
  * @return
  */
    Integer getDoAmountMoney(Date beginTime, Date endTime, Long shopId);

 /**
  * 统计指定店铺当月的已返利总额
  *
  * @param shopId
  * @return
  */
    Integer getDoAmountCheckout(Date beginTime, Date endTime, Long shopId);

 /**
  * 获取需要返利转账的数据
  *
  * @return
  */
    List<Map<String, Object>> getRebateTransferData();

    Map<String, String> saveOrder(OrderInfoDto orderInfoDto, List<CmsSecKillSkuDto> cmsSecKillSkuDtos, Boolean isUserOrder);

    /**
     * 根据店铺获取该店铺可提现的订单
     */
    List<OdsOrder> getCommissionOrders(Long shopId);

    List<CmsSecKillSkuDto> getSecKillSkus();

 /**
  * 没有下单店铺或指定时间没有下单店铺
  *
  * @param orderShopDto
  * @return
  */
    List<OrderShopDto> getOrderInformation(OrderShopDto orderShopDto);


    Wrapper reduceOrderPoint(OrderInfoDto orderInfoDto, String orderIds);

    List<OdsOrder> search(JSONObject jsonObject);

    List<OrderGoodsDto> getWmsGiftList(List<OrderGoodsDto> cmsSpecOrderDtos, Long shopId, Byte orderType);

    PageInfo<OdsOrderApiDto> getLastOrder(Integer page, Integer size);

    //Integer getLmsPrice(OrderBasicDto orderBasicDto, RecipientDto recipientDto);
    PageInfo<OrderShopDto> findDescShop(Date beginTime, Integer page, Integer size);


    PageInfo<ShopInfoDto> findNoOrderShop(Integer page, Integer size);

    List<OdsOrderApiDto> countByShopIds(List<Long> shopIdList,String beginTime,String endTime) ;

    Map countOrderByShopIds(List<Long> shopIds,  Date beginTime, Date endTime);


    List<DmsStoreOrderApi> countByDmsStore(List<DmsStoreOrderApi> dmsStoreOrderApis);

    List<ShopOrderGoodsDto> findOrderGoods(ShopOrderGoodsDto shopOrderGoodsDto);

    List<StoreOrderDto> countByShopList(List<StoreOrderDto> storeOrderDtos);
}
